<template>
  <section class="card-info">
    <div>
      <span>系统名称：</span><span>厦门市医院信息系统</span>
    </div>
    <div>
      <span>连接状态：</span><span>已经连接</span>
    </div>
    <div>
      <span>用户编号：</span><span>{{d && d.USERNAME}}</span>
    </div>
    <div>
      <span>用户名称：</span><span>{{d && d.REALNAME}}</span>
    </div>
    <div>
      <span>服务网点编号：</span><span>{{d && d.sysorg.akb020}}</span>
    </div>
    <div>
      <span>服务网点名称：</span><span>{{d && d.sysorg.orgname}}</span>
    </div>
  </section>
</template>

<script>
  export default {
    data () {
      return {
        d: null
      }
    },
    created () {
      this.$.ajax({
        type: "get",
        url: `/SYSUSER/get?USERNAME=${localStorage.user}`,
        success: (data) => {
          this.d = data;

          localStorage.aab034 = data.sysorg.akb020.slice(0, -4);
          localStorage.fwwdbh = data.sysorg.akb020.slice(-4);
        }
      });
    }
  }
</script>

<style scoped lang="scss">
  .card-info {
    margin-top: 50px;

    div {
      margin: 10px 0 0 30%;
    }

    span {
      display: inline-block;

      &:nth-child(1) {
        width: 20%;
        text-align: right;
      }

      &:nth-child(2) {
        color: #949eaf;
      }
    }
  }
</style>
